<?php

/**
 * DocEntete form base class.
 *
 * @method DocEntete getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseDocEnteteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                         => new sfWidgetFormInputHidden(),
      'date'                       => new sfWidgetFormDate(),
      'reference'                  => new sfWidgetFormInputText(),
      'lieu_livraison'             => new sfWidgetFormInputText(),
      'observation'                => new sfWidgetFormInputText(),
      'taux_remise'                => new sfWidgetFormInputText(),
      'total_h_t'                  => new sfWidgetFormInputText(),
      'total_remise'               => new sfWidgetFormInputText(),
      'total_t_v_a'                => new sfWidgetFormInputText(),
      'total_t_t_c'                => new sfWidgetFormInputText(),
      'timbre'                     => new sfWidgetFormInputCheckbox(),
      'date_livraison'             => new sfWidgetFormDate(),
      'date_validite'              => new sfWidgetFormDate(),
      'duree_validite'             => new sfWidgetFormInputText(),
      'cloture'                    => new sfWidgetFormInputCheckbox(),
      'livrer'                     => new sfWidgetFormInputCheckbox(),
      'domaine'                    => new sfWidgetFormInputCheckbox(),
      'type'                       => new sfWidgetFormInputCheckbox(),
      'mode_paiement'              => new sfWidgetFormInputCheckbox(),
      'id_contact'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'add_empty' => true)),
      'id_tiers'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tiers'), 'add_empty' => true)),
      'id_departement_source'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DepartementSource'), 'add_empty' => true)),
      'id_departement_destination' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DepartementDestination'), 'add_empty' => true)),
      'id_representant'            => new sfWidgetFormInputText(),
      'taux_escompte'              => new sfWidgetFormInputText(),
      'num_attestation_timbre'     => new sfWidgetFormInputText(),
      'date_creation'              => new sfWidgetFormDate(),
      'statut'                     => new sfWidgetFormInputText(),
      'id_conducteur'              => new sfWidgetFormInputText(),
      'id_coconducteur'            => new sfWidgetFormInputText(),
      'id_vehicule'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Vehicule'), 'add_empty' => true)),
      'confirme'                   => new sfWidgetFormInputCheckbox(),
      'valider'                    => new sfWidgetFormInputCheckbox(),
      'id_affaire'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Affaire'), 'add_empty' => true)),
      'brouillon'                  => new sfWidgetFormInputCheckbox(),
      'date_changement_etat'       => new sfWidgetFormDate(),
      'id_adresse'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Adresse'), 'add_empty' => true)),
      'etat_reglement'             => new sfWidgetFormInputCheckbox(),
      'supprimer'                  => new sfWidgetFormInputCheckbox(),
      'motif'                      => new sfWidgetFormInputText(),
      'numero_sequence'            => new sfWidgetFormInputText(),
      'nature'                     => new sfWidgetFormInputCheckbox(),
      'avance_sur_impot'           => new sfWidgetFormInputText(),
      'date_debut_periode'         => new sfWidgetFormDate(),
      'date_fin_periode'           => new sfWidgetFormDate(),
      'total_fodec'                => new sfWidgetFormInputText(),
      'journal_caisse'             => new sfWidgetFormInputCheckbox(),
      'created_at'                 => new sfWidgetFormDateTime(),
      'updated_at'                 => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'date'                       => new sfValidatorDate(),
      'reference'                  => new sfValidatorString(array('max_length' => 20)),
      'lieu_livraison'             => new sfValidatorString(array('max_length' => 70, 'required' => false)),
      'observation'                => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'taux_remise'                => new sfValidatorNumber(array('required' => false)),
      'total_h_t'                  => new sfValidatorNumber(array('required' => false)),
      'total_remise'               => new sfValidatorNumber(array('required' => false)),
      'total_t_v_a'                => new sfValidatorNumber(array('required' => false)),
      'total_t_t_c'                => new sfValidatorNumber(array('required' => false)),
      'timbre'                     => new sfValidatorBoolean(array('required' => false)),
      'date_livraison'             => new sfValidatorDate(array('required' => false)),
      'date_validite'              => new sfValidatorDate(array('required' => false)),
      'duree_validite'             => new sfValidatorInteger(array('required' => false)),
      'cloture'                    => new sfValidatorBoolean(array('required' => false)),
      'livrer'                     => new sfValidatorBoolean(array('required' => false)),
      'domaine'                    => new sfValidatorBoolean(),
      'type'                       => new sfValidatorBoolean(),
      'mode_paiement'              => new sfValidatorBoolean(array('required' => false)),
      'id_contact'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'required' => false)),
      'id_tiers'                   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Tiers'), 'required' => false)),
      'id_departement_source'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('DepartementSource'), 'required' => false)),
      'id_departement_destination' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('DepartementDestination'), 'required' => false)),
      'id_representant'            => new sfValidatorInteger(array('required' => false)),
      'taux_escompte'              => new sfValidatorNumber(array('required' => false)),
      'num_attestation_timbre'     => new sfValidatorInteger(array('required' => false)),
      'date_creation'              => new sfValidatorDate(array('required' => false)),
      'statut'                     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'id_conducteur'              => new sfValidatorInteger(array('required' => false)),
      'id_coconducteur'            => new sfValidatorInteger(array('required' => false)),
      'id_vehicule'                => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Vehicule'), 'required' => false)),
      'confirme'                   => new sfValidatorBoolean(array('required' => false)),
      'valider'                    => new sfValidatorBoolean(array('required' => false)),
      'id_affaire'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Affaire'), 'required' => false)),
      'brouillon'                  => new sfValidatorBoolean(array('required' => false)),
      'date_changement_etat'       => new sfValidatorDate(array('required' => false)),
      'id_adresse'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Adresse'), 'required' => false)),
      'etat_reglement'             => new sfValidatorBoolean(array('required' => false)),
      'supprimer'                  => new sfValidatorBoolean(array('required' => false)),
      'motif'                      => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'numero_sequence'            => new sfValidatorInteger(array('required' => false)),
      'nature'                     => new sfValidatorBoolean(array('required' => false)),
      'avance_sur_impot'           => new sfValidatorNumber(array('required' => false)),
      'date_debut_periode'         => new sfValidatorDate(array('required' => false)),
      'date_fin_periode'           => new sfValidatorDate(array('required' => false)),
      'total_fodec'                => new sfValidatorNumber(array('required' => false)),
      'journal_caisse'             => new sfValidatorBoolean(array('required' => false)),
      'created_at'                 => new sfValidatorDateTime(),
      'updated_at'                 => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('doc_entete[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DocEntete';
  }

}
